<%@page import="model.Department"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.ArrayList"%>
<%@page import="core.ProcessOwnerCore"%>
<%@page import="model.Employee"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Map"%>
<%-- 
    Document   : addNewDep
    Created on : 28 mars 2014, 10:09:53
    Author     : phinguyen
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>JSP Page</title>
        <link rel="stylesheet" href="css/ms-template.css" type="text/css">
        <script language="Javacript" src="js/javascript.js" type="text/javascript">
            
        </script>
    </head>
 
        
  <body bgcolor="#FFFFFF" background="html/claflib/bgdefault.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('html/claflib/plugin_b.gif','html/claflib/contact_ro.gif','html/claflib/closeesite_ro.gif')">


<!-- bande grise  -->

<table width="100%" border="0" cellspacing="0" cellpadding="0" height="18" bgcolor="#B8B8B8">
  <tr> 
    <td class="arbo" width="25%" height="2"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0" height="11">
        <tr> 
          <td width="10" height="2"><img src="html/claflib/pix_trans.gif" width="10" height="1"><a name="top"></a></td>
          <td width="774" height="2" valign="center" class="arbo"><font color="#333333">Home</font></td>
        </tr>
      </table>
    </td>
    <td height="2" width="75%" class="text12blue"><div align="right" class="arbo"><script>document.write(messageDate);</script>&nbsp;</div></td>
  </tr>
</table>

<!-- fin bande grise  -->


 <!-- bande bleu avec image du header -->
<table width="100%" height="51" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="1028"><img src="html/claflib/banner/banner.gif" width="785" height="51"></td>
    <td width="19"><img src="html/claflib/pix_trans.gif" width="1" height="1"></td>
    <td width="82" valign="bottom"><table width="82" height="50" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="25" valign="middle"><a href="#" onClick="self.close()"><img src="html/claflib/banner/closeesite.gif" name="close" width="80" height="14" border="0" id="close" onMouseOver="MM_swapImage('close','','html/claflib/banner/closeesite_ro.gif',1)" onMouseOut="MM_swapImgRestore()"></a></td>
        </tr>
        <tr> 
          <td height="25" valign="middle"><a href="mailto:info@airbus.com"><img src="html/claflib/banner/contact.gif" name="contact" width="53" height="14" border="0" id="contact" onMouseOver="MM_swapImage('contact','','html/claflib/banner/contact_ro.gif',1)" onMouseOut="MM_swapImgRestore()"></a></td>
        </tr>
      </table></td>
    <td width="41"><img src="html/claflib/pix_trans.gif" width="1" height="1"></td>
  </tr>
  <tr> 
    <td colspan="4" bgcolor="#FFFFFF"><img src="html/claflib/pix_trans.gif" width="1" height="1"></td>
  </tr>
</table>

<!-- fin bande bleu du header avec image  -->
<!-- Meeeeeeeeeeeeenuuuuuuuuuuuuuuuuuuuu -->
<div class="menu">

    <ul class="nav">
        <li><a href="">Section 01</a>
            <ul class="subs">
               <li><a href="">ezgfzfezfzef</a></li>
                <li><a href="">ezgfzfezfzef</a></li>
                <li><a href="">ezgfzfezfzef</a></li>
            </ul>
        </li>
        <li><a href="">Section 02</a>
            <ul class="subs">
                <li><a href="">ezgfzfezfzef</a></li>
                <li><a href="">ezgfzfezfzef</a></li>
                <li><a href="">ezgfzfezfzef</a></li>
            </ul>
        </li>
        <li><a href="">Section 04</a>
            <ul class="subs">
                <li><a href="">fdgdfgd</a></li>
                <li><a href="">ezgfzfezfzef</a></li>
                <li><a href="">ezgfzfezfzef</a></li>
            </ul>
        </li>
        <li><a href="">Section 05</a></li>
            <ul class="subs">
                <li><a href="">ezgfzfezfzef</a></li>
                <li><a href="">ezgfzfezfzef</a></li>
            </ul>
        <li><a href="">Section 06</a></li>
    </ul>
    <div style="clear:both"></div>
</div>
  <tr> 
    <td>
      <table width="00" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td valign="top" class="text12blue" align="left" colspan="3" height="90"> 
            <br>
  
            <div class="body">
                <div class="left"></div>
                <div class="mid">
                    <table class="CSSTableGenerator">
                        <tr>
                        <td>Name</td>
                        <td>Description</td>
                        <td>Director</td>
                        </tr>
                        <%
                            ProcessOwnerCore poc= new ProcessOwnerCore();
                            List<Department> lstdep=new ArrayList<Department>(poc.getAllDepartment());
                              for (int i=0; i<lstdep.size();i++){
                                out.println("<tr>");
                                out.println("<td>");
                                out.println(lstdep.get(i).getDeptname());
                                out.println("</td>");
                                out.println("<td>");
                                out.println(lstdep.get(i).getDeptdescription());
                                out.println("</td>");
                                out.println("<td>");
                                out.println(lstdep.get(i).getEmployee());
                                out.println("</td>");
                                out.println("</tr>");   
                            }
                            %>
                    </table>
                           <form method="POST" action="adddep">
                                <label class="text11boldblue" for="DeptName">Enter the name for departement</label>
                                <br>
                                <input type="text" name="DeptName"></input>
                                <br>
                                <label class="text11boldblue" for="DeptDescription">Describe the departement</label>
                                <br>
                                <input type="text" name="DeptDescription"></input>
                                <br>
                                <label class="text11boldblue" for="EmployeeDirector">Choose a director</label>
                                <br>
                                <div>
                                     <select name="EmployeeDirector">                                                                   
                                           <%
                                                 List<Employee> lstEmp= new ArrayList<Employee>(poc.getAllEmployee());
                                             for(int i=0; i<lstEmp.size();i++){
                                                 out.println("<option name=\"id\" value="+lstEmp.get(i).getEid()+">");
                                                 out.println(lstEmp.get(i).getEname()+" "+lstEmp.get(i).getEfirstname());
                                                 out.println("</option>");
                                             }
                                         %>
                                         %>
                                     </select> 
                                <br>  
                                <input type="submit" name="submit" onclick="return saisie1(DeptName)&&saisie1(DeptDescription);">  
                                </div>
                    
                </div>
                <div class="right"></div>
            </div>
    </body>
</html>
